package com.klikmee.sms.core.base;

/**
 * Cache driver is used to read & write objects into core cache.
 * It exposes methods for reading and writing. Object type is parameterized.
 * @author makcro
 *
 */
public interface CoreCacheDriver<K, T> {

        /**
         * writes object to cache using a key.
         * Key is later used to retrieve object from cache.
         * @param key key for this object
         * @param object object to cache
         */
        public void write(T object);
        
        /**
         * Reads object from cache using a key.
         * @param key key used to find object in cache
         * @return instance of cached object
         */
        public T read(K key);
        
        /**
         * Removes object from cache
         * @param object
         */
        public void remove(T object);
}